The data contained in a listbox can be grouped into logical sets through the use of GroupDescription objects. Multiple group descriptions can be added to the GroupDescriptions collection, but items are displayed in "flattened" groups. For example, given the following XAML, "Canada - Moncton" might appear in a group header followed by items with that country and city, followed by another group header containing "Canada - Montreal."
Groups are preceded by group headers (see the ListBoxGroupHeader class), which scroll with the groups. If the listbox uses a StackPanel or a StackView, the group headers can be made sticky through the IsSticky property of ListBoxContainerConfigurationBase. It is not possible to make group headers sticky when using PathPanel or PathView.
Group headers include three buttons that are mapped to commands:
The up- and down-arrow buttons are used to navigate to the group following and preceding the group, respectively, whose header was interacted with. When a group is navigated to, it is moved to the top of the listbox's viewport. (See NavigateToNextGroupCommand and NavigateToPreviousGroupCommand.)
The third button is used to open a panel that displays the listbox's groups and allows quick navigation to the chosen group. You must set the DataNavigationControl's DataNavigationConfiguration attached property in order to activate it. (See DataNavigationControl below for details.)
The DataNavigationConfiguration attached property of the DataNavigationControl class accepts the AlphabeticalDataNavigationConfiguration object.
Setting DataNavigationConfiguration to AlphabeticalDataNavigationConfiguration causes the DataNavigationControl to display keys A through Z. The first GroupDescription in GroupDescriptions must be of type string when DataNavigationConfiguration is set to an instance of AlphabeticalDataNavigationConfiguration. The following XAML configures DataNavigationControl to use keys A through Z:
Clicking on a button in the control causes the listbox to browse to the first group whose first-level GroupDescription corresponds to that letter.
The individual items in the DataNavigationControl are represented by DataNavigationItem instances.